import request from '@/utils/request'


// 入库配件详情列表
export function partsPage(form, pageSize, currentPage) {
  return request.post('/inStorage/partsPage', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}

// 入库配件详情列表
export function partsDetailPage(form, pageSize, currentPage) {
  return request.post('/inStorage/partsDetailPage', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}


// 编辑详情
export function getFindById(id) {
  return request.get('/inStorage/findById/' + id)
}

// 删除
export function deleteById(id) {
  return request.delete('/inStorage/del/' + id)
}

// 详情
export function getDetail(id) {
  return request.get('/inStorage/detail/' + id)
}


//获取分页数据 
export function page(form, pageSize, currentPage) {
  return request.post('/inStorage/page', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}

// 获取出库编号
export function getStorageCode() {
  return request.get('/inStorage/getStorageCode')
}

//新增 
export function add(form) {
  return request.post('/inStorage/save', form)
}

//修改
export function update(form) {
  return request.put('/inStorage/save', form)
}

// 根据来源单号查询配件信息
export function findSourceCode(inStorageType, sourceCode) {
  return request.get('/inStorage/findSourceCode/' + inStorageType + "/" + sourceCode)
}
